package com.lizhi.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

import java.util.ArrayList;
import java.util.List;

public enum SubTaskState {
    NOT_START("not_start"),
    EXECUTING("executing"),
    FAILED("failed"),
    SUCCESS("success");
    @EnumValue
    private final String code;

    SubTaskState(String code) {
        this.code = code;
    }

    public static List<SubTaskState> initSubTaskState(int len) {
        List<SubTaskState> ans = new ArrayList<>();
        for (int i = 0; i < len; i++) {
            ans.add(SubTaskState.NOT_START);
        }
        return ans;
    }

    public String getCode() {
        return code;
    }

    @Override
    public String toString() {
        return code;
    }
}
